function vsGet(act, id) {
	$("#"+id).html('<img src="http://style.worldgames.vn/images/profile/loading_anim.gif"/>');
	$.get(ajaxurl+act,function(data){
		$("#"+id).html(data);
		}
	);
}
var doing=false;

function vsMakeFormUrl(obj) {
	var getstr = "&";
	
		for (i=0; i<obj.getElementsByTagName('textarea').length; i++)
			getstr += obj.getElementsByTagName('textarea')[i].name+"="+encodeURI(obj.getElementsByTagName('textarea')[i].value)+"&";
			
		for (i=0; i<obj.getElementsByTagName('select').length; i++)
			getstr += obj.getElementsByTagName('select')[i].name+"="+encodeURI(obj.getElementsByTagName('select')[i].value)+"&";
			
		for (i=0; i<obj.getElementsByTagName('input').length; i++) {
			if(obj.getElementsByTagName('input')[i].type=="radio")
				if(obj.getElementsByTagName('input')[i].checked)
					getstr += obj.getElementsByTagName('input')[i].name+"="+encodeURI(obj.getElementsByTagName('input')[i].value)+"&";

			if(obj.getElementsByTagName('input')[i].type=="checkbox")
				if(obj.getElementsByTagName('input')[i].checked)
					getstr += obj.getElementsByTagName('input')[i].name+"="+encodeURI(obj.getElementsByTagName('input')[i].value)+"&";
				else
					getstr += obj.getElementsByTagName('input')[i].name+"=&";
			
			if(obj.getElementsByTagName('input')[i].type=="hidden")
				getstr += obj.getElementsByTagName('input')[i].name+"="+encodeURI(obj.getElementsByTagName('input')[i].value)+"&";

			if(obj.getElementsByTagName('input')[i].type=="text")
				getstr += obj.getElementsByTagName('input')[i].name+"="+encodeURI(obj.getElementsByTagName('input')[i].value)+"&";
			
			if(obj.getElementsByTagName('input')[i].type=="password")
				getstr += obj.getElementsByTagName('input')[i].name+"="+encodeURI(obj.getElementsByTagName('input')[i].value)+"&";
		}
	return getstr;
}

function vsSubmitForm(obj,act,id) {
	$("#"+id).html('<img src="style.worldgames.vn/images/private/loader.gif"/>');
	var params = {};
	var count = 0;
	$(obj)
	.find("input[@checked], input[@type='text'], input[@type='hidden'], input[@type='password'], input[@type='submit'], option[@selected], textarea")
	.filter(":enabled")
	.each(function() {
			params[ this.name || this.id || this.parentNode.name || this.parentNode.id ] = this.value;
	});
		
	$.post(ajaxurl+act,params,function(data) {
		$("#"+id).html(data);
	});
}